********************************************************************************
************ This program loads input cost data for petrol stations ************
********************************************************************************		

**********************
*** Regular Petrol ***
**********************

// Load data
cd "$raw"
import excel "02_Other_Datasets\20180427_MWV_Spritbeschaffungskosten_Steuern.xlsx" , clear first sh("Superbenzin")
drop I J K

// Drop unnecessary variables and rename
drop Nettopreis Mehrwertsteuer Verbraucherpreis Deckungsbeitrag
rename Jahr year
rename Monat month
rename Produktbeschaffungskosten input_cost
rename Mineralölsteuer fuel_tax

// Rename months
replace month = "1" if month == "Jan"
replace month = "2" if month == "Feb"
replace month = "3" if month == "Mrz" | month == "Mär" | month == "Mar"
replace month = "4" if month == "Apr"
replace month = "5" if month == "Mai"
replace month = "6" if month == "Jun"
replace month = "7" if month == "Jul"
replace month = "8" if month == "Aug"
replace month = "9" if month == "Sep"
replace month = "10" if month == "Okt"
replace month = "11" if month == "Nov"
replace month = "12" if month == "Dez"
destring month , replace

// Input lump sum storage levy for petrol: EBV (0,27 Eurocent pro Liter)
gen ebv=0.0027
label variable ebv "EBV in Euro per litre, petrol"

// Save data
cd "$dta"
save input_cost_petrol.dta , replace



**************
*** Diesel ***
**************

// Load data
cd "$raw"
import excel "02_Other_Datasets\20180427_MWV_Spritbeschaffungskosten_Steuern.xlsx" , clear first sh("Dieselkraftstoff")
drop I J K

// Drop unnecessary variables and rename
drop Nettopreis Mehrwertsteuer Verbraucherpreis Deckungsbeitrag
rename Jahr year
rename Monat month
rename Produktbeschaffungskosten input_cost_diesel
rename Mineralölsteuer fuel_tax_diesel

// Rename months
replace month = "1" if month == "Jan"
replace month = "2" if month == "Feb"
replace month = "3" if month == "Mrz" | month == "Mär" | month == "Mar"
replace month = "4" if month == "Apr"
replace month = "5" if month == "Mai"
replace month = "6" if month == "Jun"
replace month = "7" if month == "Jul"
replace month = "8" if month == "Aug"
replace month = "9" if month == "Sep"
replace month = "10" if month == "Okt"
replace month = "11" if month == "Nov"
replace month = "12" if month == "Dez"
destring month , replace

// Input lump sum storage levy for diesel: EBV (0,30 Eurocent pro Liter)
gen ebv_diesel=0.0030
label variable ebv_diesel "EBV in Euro per litre, diesel"

// Save data
cd "$dta"
save input_cost_diesel.dta , replace
